package org.example.design.observer.event.service.impl;

import org.example.design.observer.MinibusTargetService;
import org.example.design.observer.bean.LotteryResult;
import org.example.design.observer.event.service.LotteryService;

import java.util.Date;

/**
 * @Classname LotteryServiceImpl
 * @Description TODO
 * @Date 2020/11/11 10:55 上午
 * @Created by xiangjd
 */
public class LotteryServiceImpl extends LotteryService {

    private MinibusTargetService minibusTargetService = new MinibusTargetService();

    @Override
    protected LotteryResult doDraw(String uid) {
        //摇号
        String lottery = minibusTargetService.lottery(uid);
        //结果
        return new LotteryResult(uid, lottery, new Date());
    }
}
